

class SimpleIndirectionBlock(object):



    def __init__(self):
        self.maxSize = 32 
        self.dataBlockPointers = {} 
        
        
    
    def hasSpace(self):
        return (len(self.dataBlockPointers) < self.maxSize)

    
    def addDataPointer(self,aPointer, aCounter):
        if (self.hasSpace()):
            if(not(self.dataBlockPointers.__contains__(aPointer))): 
                self.dataBlockPointers[aPointer]=aCounter
        
    
    def getDataBlockPointers(self):
        return self.dataBlockPointers
            
    def removeDataPointer(self, aPointer):
        del(self.getDataBlockPointers())[aPointer]
        
    def contains(self,aPointer):
        return (self.dataBlockPointers.__contains__(aPointer))
        
    def getBlocks(self):
        j = self.getDataBlockPointers().__iter__()
        listOfBlocks = []
        listOfBlocks.extend(j)
        return listOfBlocks